int size)
{
MetaWindow *window = NULL;
- ClutterActor *actor;
+ StWidget *widget;
gint scale;
ShellGlobal *global;
StThemeContext *context;
if (window == NULL)
{
+ ClutterActor *actor;
+
actor = clutter_actor_new ();
g_object_set (actor, "opacity", 0, "width", (float) size, "height", (float) size, NULL);
return actor;
}
- actor = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
- G_OBJECT (window),
- "icon",
- size);
- return actor;
+ widget = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
+ G_OBJECT (window),
+ "icon",
+ size);
+ return CLUTTER_ACTOR (widget);
}
/**
* If the source object is destroyed, the texture will continue to show the last
* value of the property.
*
- * Return value: (transfer none): A new #ClutterActor
+ * Return value: (transfer none): A new #StWidget
*/
-ClutterActor *
+StWidget *
st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
GObject *object,
const char *property_name,
gint size)
{
- ClutterActor *actor;
+ StWidget *widget;
gchar *notify_key;
StTextureCachePropertyBind *bind;
- actor = create_invisible_actor ();
- clutter_actor_set_size (actor, size, size);
+ widget = g_object_new (ST_TYPE_WIDGET,
+ "opacity", 0,
+ "width", (float)size,
+ "height", (float)size,
+ NULL);
bind = g_slice_new0 (StTextureCachePropertyBind);
bind->cache = cache;
- bind->actor = actor;
+ bind->actor = CLUTTER_ACTOR (widget);
bind->size = size;
bind->source = object;
- g_object_weak_ref (G_OBJECT (actor), st_texture_cache_bind_weak_notify, bind);
+ g_object_weak_ref (G_OBJECT (widget), st_texture_cache_bind_weak_notify, bind);
bind->weakref_active = TRUE;
st_texture_cache_reset_texture (bind, property_name);
bind, (GClosureNotify)st_texture_cache_free_bind, 0);
g_free (notify_key);
- return actor;
+ return widget;
}
/**
#include <st/st-types.h>
#include <st/st-theme-node.h>
+#include <st/st-widget.h>
#define ST_TYPE_TEXTURE_CACHE (st_texture_cache_get_type ())
G_DECLARE_FINAL_TYPE (StTextureCache, st_texture_cache,
GFunc load_callback,
gpointer user_data);
-ClutterActor *st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
- GObject *object,
- const char *property_name,
- gint size);
+StWidget *st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
+ GObject *object,
+ const char *property_name,
+ gint size);
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
StThemeNode *theme_node,